package Java_Concurrency_in_Practice.c5_3_1;

import java.io.File;
import java.util.concurrent.BlockingQueue;

/**
 * 消费者任务<br>
 * 从队列中读取文件名称, 并对它们建立索引
 * @author xiangke
 *
 */
public class Indexer implements Runnable {

	private final BlockingQueue<File> queue;
	
	public Indexer(BlockingQueue<File> queue) {
		this.queue = queue;
	}
	
	@Override
	public void run() {
		try {
			while (true) {
				indexFile(queue.take());
			}
		} catch (Exception e) {
			Thread.currentThread().interrupt();
		}
	}

	private void indexFile(File take) {
		
	}

}
